package com.newcapec.lesson5;

public  class Person extends Object implements Cloneable,Comparable<Person>{
     public String name;
     public static int count = 0;
     private final char value[];
     private int objNumber;

     public Person() {
          value = new char[10];
     }

     public  void eat(){};

     {
          this.objNumber = ++count;
     }

     public int getObjNumber() {
          return objNumber;
     }

     @Override
     protected void finalize() throws Throwable {
          System.out.println(this.objNumber+"号对象被回收");
          count--;
          
     }

     @Override
     protected Object clone() throws CloneNotSupportedException {
          return super.clone();
     }

     @Override
     public int compareTo(Person o) {
          return 0;
     }
}
